//
//  ListTableViewCell.m
//  10-易车
//
//  Created by dllo on 16/7/27.
//  Copyright © 2016年 LST. All rights reserved.
//

#import "ListTableViewCell.h"
#import "ListModel.h"
#import "UIImageView+WebCache.h"
@implementation ListTableViewCell
- (void)setModel:(ListModel *)model {
    _model = model;
    _labelTitle.text = model.title;
    [_imageViewPicCover sd_setImageWithURL:[NSURL URLWithString:model.picCover] placeholderImage:[UIImage imageNamed:@"picholder"]];
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatSubView];
    }
    return self;
    
}
- (void)creatSubView{
    self.imageViewPicCover = [[UIImageView alloc] initWithFrame:CGRectZero];
    [self.contentView addSubview:self.imageViewPicCover];
    
    self.labelTitle = [[UILabel alloc] initWithFrame:CGRectZero];
    self.labelTitle.numberOfLines = 1;
    self.labelTitle.font = [UIFont systemFontOfSize:17 weight:0.3];
    [self.contentView addSubview:self.labelTitle];
    
}


- (void)layoutSubviews{
    [super layoutSubviews];
    
    self.imageViewPicCover.frame = CGRectMake(self.frame.size.width * 0.03, self.frame.size.height * 0.1, self.frame.size.width * 0.3, self.frame.size.height * 0.8);
    
    self.labelTitle.frame = CGRectMake(self.frame.size.width * 0.35, self.frame.size.height * 0.2, self.frame.size.width * 0.6, self.frame.size.height * 0.6);
    
}

@end
